package rus.service.impl;

import java.util.List;

import rus.dao.ProductDAO;
import rus.model.Product;
import rus.service.ProductManager;

public class ProductManagerImpl extends UniversalManagerImpl implements
		ProductManager {
	
	private ProductDAO productDAO;
	
	

	public void setProductDAO(ProductDAO productDAO) {
		this.productDAO = productDAO;
	}

	public ProductDAO getProductDAO() {
		return productDAO;
	}

	public void createProduct(Product product) {
		productDAO.saveOrUpdate(product);		
	}

	public List<Product> getProductList() {
		return productDAO.getAll();
	}

	public Product getById(Long id) {
		return productDAO.get(id);
	}

	public void delete(Product product) {
		productDAO.remove(product.getId());
		
	}

}
